import { defineStore } from "pinia";
import { getTotal } from "@/api/fis";
import { computed, onMounted, ref } from 'vue'

export const useTotalStore = defineStore('Total', () => {
    let totalData = ref([])
    let printOption = ref([])
    const getTotalData = async () => {
        let res = await getTotal()
        totalData.value = res
        printOption.value = res.map(item => item.partTypeName)
    }
    onMounted(() => {
        getTotalData()
    })
    return {
        totalData,
        printOption
    }
})